<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <script src="./lib/vue.js"></script>
</body>

</html>
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./lib/vue.js"></script>
</head>

<body>
  <div id="app">

    <h3>用户登录</h3>
    <div>
      <label>
        账号：
        <!-- 文本框 :value @input -->
        <input type="text" v-model="username">
      </label>
    </div>
    <div>
      <label>
        账号：
        <input type="text" v-model="password">
      </label>
    </div>
    <div>
      <!-- 多行文本框 -->
      <textarea v-model="message" style="width: 300px; height: 160px;"></textarea>
    </div>
    <div>
      <button @click="login">进入系统</button>
    </div>
    <hr>
    <div v-html="messageFn()"></div>
  </div>

  <script>
    let vm = new Vue({
      el: '#app',
      data: {
        username: 'admin',
        password: '',
        message: ''
      },
      methods: {
        login() {
          console.log(this.$data)
        },
        messageFn() {
          return this.message.replace(/\n/g, "<br>")
        }
      }
    })
  </script>
</body>

</html>